package dcc.service;

import dcc.model.OutsideProvinceExpertsInfo;
import dcc.persistence.OutsideProvinceExpertsMapper;

public class OutsideProvinceExpertsService extends BaseService {

	private OutsideProvinceExpertsMapper outsideProvinceExpertsMapper;

	public void setOutsideProvinceExpertsMapper(
			OutsideProvinceExpertsMapper outsideProvinceExpertsMapper) {
		this.outsideProvinceExpertsMapper = outsideProvinceExpertsMapper;
	}

	public OutsideProvinceExpertsService() {
		super(OutsideProvinceExpertsService.class);

	}

	public void save(OutsideProvinceExpertsInfo outsideProvinceExpertsInfo) {
		if (outsideProvinceExpertsInfo.getId() == 0) {
			insert(outsideProvinceExpertsInfo);
		} else {
			update(outsideProvinceExpertsInfo);
		}
	}

	private void insert(OutsideProvinceExpertsInfo outsideProvinceExpertsInfo) {
		outsideProvinceExpertsMapper.insert(outsideProvinceExpertsInfo);
	}

	private void update(OutsideProvinceExpertsInfo outsideProvinceExpertsInfo) {
		outsideProvinceExpertsMapper.update(outsideProvinceExpertsInfo);
	}

	public OutsideProvinceExpertsInfo getOutsideProvinceExpertsInfoByBaseId(
			int baseId) {
		return outsideProvinceExpertsMapper
				.getOutsideProvinceExpertsInfoByBaseId(baseId);
	}
}
